package com.wanmait.spacesys.util;



public class StringUtil {
	/**
	 * 判断字符串是不是空
	 * null或者空格
	 * @param str
	 * @return
	 */
	public boolean empty(String str) {
		if(str==null) return true;
		if(str.trim().length()==0) return true;
		return false;
	}
	/**
	 * repeatStr 判断是否重复
	 * @param len
	 * @param fillChar
	 * @return
	 */
	public static String repeatStr(int len,char fillChar) {
		StringBuilder buf = new StringBuilder();
		for(int i=0;i<len;i++) {
			buf.append(fillChar);
		}
		return buf.toString();
	}
	public static String lpad(int num,int len,char fillChar) {
		return lpad(num+"", len, fillChar);
	}
	/**
	 * 
	 * @param str
	 * @param len 长度
	 * @param fillChar 填充的字符
	 * @return
	 */
	public static String lpad(String str,int len,char fillChar) {
		int count = len-str.length();
		String pre = repeatStr(count, fillChar);
		return pre+str;
	}
	public static void main(String[] args) {
		System.out.println(lpad(9998,10,'0'));
	}
}
